﻿<%@ Page Language="VB" AutoEventWireup="false" CodeFile="CustomerInvoice.aspx.vb"
    Inherits="Arwani.CustomerInvoice" %>

<%@ Register Src="../header.ascx" TagName="header" TagPrefix="uc1" %>
<%@ Register Src="../Footer.ascx" TagName="Footer" TagPrefix="uc2" %>
<%@ Register Src="../CopyRight.ascx" TagName="CopyRight" TagPrefix="uc3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Customer</title>
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript" src="../js/jquery.min.js"></script>
    <style>
        label
        {
            color: #000 !important;
            font: 13px "Trebuchet MS" ,Arial,Helvetica,sans-serif;
        }
        a.send-btn
        {
            background: none repeat scroll 0 0 #646464;
            border-radius: 3px 3px 3px 3px;
            float: left;
            font-weight: bold;
            padding: 5px 10px;
        }
        .promo-form
        {
            float: left !important;
        }
        .promo-form input
        {
            background: none repeat scroll 0 0 #FFFFFF !important;
            border: 1px solid #CCCCCC !important;
            color: #000000 !important;
            padding: 5px !important;
        }
        .invoice-gridview
        {
            border-collapse: collapse;
            border: 1px solid #A9A9A9;
            color: Black;
            margin-bottom: 20px;
            text-align: left;
            width: 100%;
        }
        .invoice-gridview td, .invoice-gridview th
        {
            padding: 3px 5px;
            vertical-align: middle;
        }
        
        .invoice-gridview td
        {
            color: #333333;
        }
    </style>
    <script type="text/javascript">
        function showNestedGridView(obj) {
            var nestedGridView = document.getElementById(obj);
            var imageID = document.getElementById('image' + obj);

            if (nestedGridView.style.display == "none") {
                nestedGridView.style.display = "inline";
                imageID.src = "minus.png";
            } else {
                nestedGridView.style.display = "none";
                imageID.src = "plus.png";
            }
        }
    </script>
    <link href="../css/admin/style.css" rel="stylesheet" type="text/css" />

 <script type="text/javascript">
     function PrintGridView(invoiceno) {
         newValue = "ID-" + invoiceno;
         showNestedGridView(newValue);
         var _printgridview = document.getElementById(newValue);
        _printgridview.style.display = 'inline';
            _printgridview.border = 0;
            var _printwindow = window.open('', 'CodeToPrintGridViewData','left=100,top=100,width=800,height=400,tollbar=0,scrollbars=1,status=0,resizable=1');
            _printwindow.document.write(_printgridview.outerHTML);
            _printwindow.document.close();
            _printwindow.focus();
            _printwindow.print();
            _printwindow.close();
        }
</script>


</head>
<body>
    <form id="form1" runat="server">
    <div id="main">
           <uc1:header ID="header1" runat="server" />
            <div style="height:40px;"></div>
        <div id="content">
            <div>
                <img src="../images/spacer.gif" width="1" height="7" alt="spacer" /></div>

                <table width="100%">
                <tr>
                <td style="width:13%;">
                  <asp:Label ID="lblCustomerName" runat="server" Text="Company Name:"></asp:Label>
                </td>
                <td style="width:40%;">
                  <asp:Label ID="lblCustomer" runat="server" Font-Bold="true" Text=""></asp:Label>
                </td>
                <td align="right">
                <asp:LinkButton ID="lnkRequestForService" runat="server" Font-Bold="true" Font-Underline="true">Request for Service</asp:LinkButton>
             
                </td>
                </tr>
                </table>

          
          
            
            <table><tr><td style="height:20px;"></td></tr></table>
            <asp:GridView ID="gridViewMaster"  CssClass="table" runat="server" AllowPaging="True"
                AutoGenerateColumns="False" CellPadding="0" Cellspecing="0" DataKeyNames="ID"
                ForeColor="Black" GridLines="None" Width="100%">
                <Columns>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <a href="javascript:showNestedGridView('ID-<%# Eval("ID") %>');">
                                <img id="imageID-<%# Eval("ID") %>" alt="Click to show/hide orders" border="0" src="plus.png" />
                            </a>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="No.">
                        <ItemTemplate>
                            <asp:Label ID="lblID" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Article No">
                        <ItemTemplate>
                            <asp:Label ID="lblarticleNo" runat="server" Text='<%# Eval("Articleno") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Serial No.">
                        <ItemTemplate>
                            <asp:Label ID="lblSerialNo" runat="server" Text='<%# Eval("Serialno") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Purchase Date">
                        <ItemTemplate>
                            <asp:Label ID="lblDate" runat="server" Text='<%#Eval("INVOICE DATE","{0:dd/MM/yyyy}")%>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>

                      <asp:TemplateField HeaderText="">
                        <ItemTemplate>
                            
                             <asp:Label ID="lblcheck1" runat="server" text='<%# GetCheckedOutValueM(HttpUtility.HtmlDecode(Eval("Manuals").ToString()))%>' /> 
                        </ItemTemplate>
                    </asp:TemplateField>

                    <asp:TemplateField>
                        <ItemTemplate>
                            <tr>
                                <td colspan="100%" style="padding:0px;">
                                    <div id="ID-<%# Eval("ID") %>" style="display: none; position: relative; left: 25px;">
                                        <asp:GridView ID="nestedGridView" CellPadding="0" CellSpacing="0" Border="0" Style="margin-bottom: 10px;margin-top: 10px;
                                            border: 0.1em solid #A9A9A9;" Width="95%" GridLines="None" runat="server" AutoGenerateColumns="False"
                                            DataKeyNames="invoiceno" OnRowDataBound="nestedGridView_RowDataBound">
                                            <RowStyle VerticalAlign="Top" ForeColor="#333333" />
                                            <Columns>
                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <a href="javascript:showNestedGridView('ID-<%# Eval("invoiceno") %>');">
                                                            <img id="imageID-<%# Eval("invoiceno") %>" alt="Click to show/hide orders" border="0"
                                                                src="plus.png" />
                                                        </a>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Invoice No">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblinvoiceno" runat="server" Text='<%# Eval("invoiceno") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Amount">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lbltotalamt" runat="server" Text='<%#Eval("totalamt","{0:f2}")%>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Repair Date">
                                                    <ItemTemplate>
                                                        <asp:Label ID="deldate" runat="server" Text='<%#Eval("deldate","{0:dd/MM/yyyy}")%>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>

                                                <asp:TemplateField HeaderText="">
                        <ItemTemplate>
                            <a style="cursor:pointer;text-decoration:none;" onclick="javascript:PrintGridView('<%# Eval("invoiceno") %>');">Print</a> &nbsp;/
                             &nbsp; 
                             
                              <asp:Label ID="lblcheck" runat="server" text='<%# GetCheckedOutValue(HttpUtility.HtmlDecode(Eval("jobcard").ToString()))%>' /> 

                             <%--<a href="../Invoices/<%# Eval("jobcard") %>" target="_blank"><asp:Label ID="lblJobCard" runat="server" Text='Job Card'></asp:Label></a>--%>
                        </ItemTemplate>
                    </asp:TemplateField>



                                                <asp:TemplateField>
                                                    <ItemTemplate>
                                                        <tr>
                                                            <td colspan="100%" style="padding:0px;">
                                                                <div id="ID-<%# Eval("invoiceno") %>" style="display: none;
                                                                    position: relative; left: 25px;">
                                                                    <asp:GridView ID="nestedGridView2" Style="margin: 10px;border: 0.1em solid #A9A9A9; width: 92%;"
                                                                        runat="server" AutoGenerateColumns="False" DataKeyNames="invoiceno"
                                                                         >
                                         
                                                                        <RowStyle VerticalAlign="Top" BackColor="White" ForeColor="#330099" />
                                                                        <Columns>
                                                                            <asp:TemplateField HeaderText="NO.">
                                                                                <ItemTemplate>
                                                                                    <asp:Label ID="lblinvoiceno" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                            <asp:TemplateField HeaderText="ARTICLE NO.">
                                                                                <ItemTemplate>
                                                                                    <asp:Label ID="lbarticleno" runat="server" Text='<%# Eval("articleno") %>'></asp:Label>
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                            <asp:TemplateField HeaderText="DESCRIPTION">
                                                                                <ItemTemplate>
                                                                                    <asp:Label ID="lbldescription" runat="server" Text='<%# Eval("description") %>'></asp:Label>
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                            <asp:TemplateField HeaderText="QTY">
                                                                                <ItemTemplate>
                                                                                    <asp:Label ID="lbldescription" runat="server" Text='<%# Eval("qty") %>'></asp:Label>
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                            <asp:TemplateField HeaderText="PRICE">
                                                                            <ItemStyle HorizontalAlign="Right"/>
                                                                            <HeaderStyle HorizontalAlign="Right"/>
                                                                                <ItemTemplate>
                                                                                    <asp:Label ID="lbldescription" runat="server" Text='<%# String.Format("{0:f2}", DataBinder.Eval(Container.DataItem, "price")) %>'></asp:Label>
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                            <asp:TemplateField HeaderText="AMOUNT">
                                                                               <ItemStyle HorizontalAlign="Right"/>
                                                                                <HeaderStyle HorizontalAlign="Right"/>
                                                                                <ItemTemplate>
                                                                                    <asp:Label ID="lbldescription" runat="server" Text='<%# String.Format("{0:f2}", DataBinder.Eval(Container.DataItem, "nett")) %>'></asp:Label>
                                                                                </ItemTemplate>
                                                                            </asp:TemplateField>
                                                                        </Columns>
                                                                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Left"/>
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                                                    </asp:GridView>
                                                                </div>
                                                            </td>
                                                        </tr>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        
                                             <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" BorderColor="Black"/>
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                        </asp:GridView>
                                    </div>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
              

                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#EFF3FB" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />

            </asp:GridView>
            <div class="clear">
            </div>
            
        </div>
        <div style="line-height:10px;"></div>
         <table><tr><td style="height:20px;"></td></tr></table>
        <uc3:CopyRight ID="CopyRight1" runat="server" />
    </div>
    </form>
</body>
</html>
<script type="text/javascript">
    $(document).ready(function () {
        $("#accountLogin").hide();
    });
    
</script>
